package com.flying.invest.strategy.model;

import com.flying.common.util.Codes;
import com.flying.framework.annotation.ConstantEnum;
import com.flying.framework.annotation.Param;
import com.flying.framework.data.Data;
import com.flying.framework.data.DataSerializable;
import com.flying.framework.metadata.Meta;

@SuppressWarnings("serial")
@Meta(id="i_strategy_house",title="网格建仓策略", table="i_strategy_house", primaryKeys={"strategy_id"})
public class StrategyHouse extends Data implements DataSerializable {
	public final static String ENTITY_NAME = "i_strategy_house";
	
	public final static String STRATEGY_ID = "strategy_id";
	public final static String PRICE_BENCHMARK = "price_benchmark";
	public final static String PRICE_MIN = "price_min";
	public final static String PRICE_INTERVAL = "price_interval";
	public final static String PRICE_INTERVAL_TYPE = "price_interval_type";
	public final static String AMOUNT = "amount";
	public final static String QUANTITY = "quantity";
	public final static String COMMISSION_TYPE = "commission_type";


	public enum IntervalType implements ConstantEnum<Integer> {
		AMOUNT(0, "金额"), RATE(1, "比例");

		public final int value;
		public final String remarks;

		IntervalType(int value, String remarks) {
			this.value = value;
			this.remarks = remarks;
		}
		
		@Override
		public Integer value() {
			return this.value;
		}

		@Override
		public String text() {
			return remarks;
		}
	}

	public enum CommissionType implements ConstantEnum<Integer> {
		QUANTITY(0, "固定数量"), AMOUNT(1, "固定金额");

		public final int value;
		public final String remarks;

		CommissionType(int value, String remarks) {
			this.value = value;
			this.remarks = remarks;
		}
		
		@Override
		public Integer value() {
			return this.value;
		}

		@Override
		public String text() {
			return remarks;
		}
	}
	
	@Param(value=STRATEGY_ID, required=true, desc="策略ID")
	private Long strategyId;
	
	@Param(value=PRICE_BENCHMARK, required=true, desc="基准价格" )
	private Double priceBenchmark;
	
	@Param(value=PRICE_MIN, required=true, desc="价格下限" )
	private Double priceMin;
	
	@Param(value=PRICE_INTERVAL, required=true, desc="网格价格" )
	private Double priceInterval;
	
	@Param(value=PRICE_INTERVAL_TYPE, required=true, desc="区间类型", enumClass=IntervalType.class )
	private Integer priceIntervalType;
	
	@Param(value=AMOUNT, required=false, desc="委托金额" )
	private Double amount;
	
	@Param(value=QUANTITY, required=false, desc="委托数量" )
	private Double quantity;
	
	@Param(value=COMMISSION_TYPE, required=true, desc="委托类型", enumClass=CommissionType.class )
	private Integer commissionType;
	
	
	public Long getStrategyId() {
		return this.strategyId;
	}
	
	public void setStrategyId(Long strategyId) {
		this.strategyId = strategyId;
	}
	
	public Double getPriceBenchmark() {
		return this.priceBenchmark;
	}
	
	public void setPriceBenchmark(Double priceBenchmark) {
		this.priceBenchmark = priceBenchmark;
	}
	
	public Double getPriceMin() {
		return this.priceMin;
	}
	
	public void setPriceMin(Double priceMin) {
		this.priceMin = priceMin;
	}
	
	public Double getPriceInterval() {
		return this.priceInterval;
	}
	
	public void setPriceInterval(Double priceInterval) {
		this.priceInterval = priceInterval;
	}
	
	public Integer getPriceIntervalType() {
		return this.priceIntervalType;
	}
	
	public void setPriceIntervalType(Integer priceIntervalType) {
		this.priceIntervalType = priceIntervalType;
	}
	
	public Double getAmount() {
		return this.amount;
	}
	
	public void setAmount(Double amount) {
		this.amount = amount;
	}
	
	public Double getQuantity() {
		return this.quantity;
	}
	
	public void setQuantity(Double quantity) {
		this.quantity = quantity;
	}
	
	public Integer getCommissionType() {
		return this.commissionType;
	}
	
	public void setCommissionType(Integer commissionType) {
		this.commissionType = commissionType;
	}
	

}